﻿/*----------------------------------------------------------------
//  <copyright file="TikTokExtensions.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2023-09-25 17:20</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud
{
    #region "抖音身份认证扩展方法"
    /// <summary>
    /// 抖音身份认证扩展方法
    /// </summary>
    public static class TikTokExtensions
    {
        #region "扩展方法"
        #region "添加抖音身份认证"
        /// <summary>
        /// 添加抖音身份认证
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static AuthenticationBuilder AddTikTok(this AuthenticationBuilder builder)
        {
            return builder.AddTikTok(TikTokDefaults.AuthenticationScheme, TikTokDefaults.DisplayName, options => { });
        }
        #endregion
        #region "添加抖音身份认证"
        /// <summary>
        /// 添加抖音身份认证
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="configureOptions"></param>
        /// <returns></returns>
        public static AuthenticationBuilder AddTikTok(this AuthenticationBuilder builder, Action<TikTokOptions> configureOptions)
        {
            return builder.AddTikTok(TikTokDefaults.AuthenticationScheme, TikTokDefaults.DisplayName, configureOptions);
        }
        #endregion
        #region "添加抖音身份认证"
        /// <summary>
        /// 添加抖音身份认证
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="authenticationScheme"></param>
        /// <param name="configureOptions"></param>
        /// <returns></returns>
        public static AuthenticationBuilder AddTikTok(this AuthenticationBuilder builder, string authenticationScheme, Action<TikTokOptions> configureOptions)
        {
            return builder.AddTikTok(authenticationScheme, TikTokDefaults.DisplayName, configureOptions);
        }
        #endregion
        #region "添加抖音身份认证"
        /// <summary>
        /// 添加抖音身份认证
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="authenticationScheme"></param>
        /// <param name="displayName"></param>
        /// <param name="configureOptions"></param>
        /// <returns></returns>
        public static AuthenticationBuilder AddTikTok(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<TikTokOptions> configureOptions)
        {
            return builder.AddOAuth<TikTokOptions, TikTokHandler>(authenticationScheme, displayName, configureOptions);
        }
        #endregion

        #endregion

    }
    #endregion

}
